package com.example.demo.project.utils;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * Created by Administrator on 2017/10/24.
 */
public class TempWebUtils {

    public static Path getClassRealPath(Class<?> type) {
        Path classPath = Paths.get(type.getResource("/").getPath().replaceAll("^/", "").replaceAll("%20", " "));
        Path realPath = classPath.resolve(type.getPackage().getName().replaceAll("\\.", String.valueOf(File.separator + File.separator))).toAbsolutePath();
        return realPath;
    }
}
